{% extends "base.html" %}

{% load extras %}

{% block container %}
<button onclick="location.href='/add/'" class="button btn-primary" type="button">データ追加</button>
<p style="text-align:right;">データ数：{{ count }}</p>
<table class="table table-hover">
	<thead>
		<tr>
		<th>名前</th>
		<th>住所</th>
		<th>電話</th>
		<th>編集</th>
		<th>削除</th>
		</tr>
	</thead>
{% for addr in addrs %}
	<tbody>
		<tr>
			<td>{{ addr.name }}</td>
			<td>{{ addr.address }}</td>
			<td>{{ addr.tel }}</td>
			<td><button onclick="location.href='/edit/{{ addr.key|getID:'' }}/'" class="button btn-warning" type="button">編集</button></td>
			<td><button onclick="location.href='/delete/{{ addr.key|getID:''  }}/'" class="button btn-danger" type="button">削除</button></td>
		</tr>
	</tbody>
{% endfor %}
</table>
{% endblock container %}